<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');

$dictionary['tasks_documents'] = array ( 'table' => 'tasks_documents'
      , 'fields' => array (
       array('name' =>'id', 'type' =>'varchar', 'len'=>'36')
      , array('name' =>'document_id', 'type' =>'varchar', 'len'=>'36', )
      , array('name' =>'task_id', 'type' =>'varchar', 'len'=>'36', )
      , array ('name' => 'date_modified','type' => 'datetime')
      , array('name' =>'deleted', 'type' =>'bool', 'len'=>'1', 'default'=>'0', 'required'=>false)
      )
      , 'indices' => array (
       array('name' =>'tasks_documentspk', 'type' =>'primary', 'fields'=>array('id'))
      , array('name' => 'idx_task_document', 'type'=>'alternate_key', 'fields'=>array('task_id','document_id'))
      , array('name' => 'idx_docid_del_taskid', 'type' => 'index', 'fields'=> array('document_id', 'deleted', 'task_id'))
      )

      ,'relationships' => array ('tasks_documents' => array('lhs_module'=> 'Tasks', 'lhs_table'=> 'tasks', 'lhs_key' => 'id',
                                                          'rhs_module'=> 'Documents', 'rhs_table'=> 'documents', 'rhs_key' => 'id',
                                                          'relationship_type'=>'many-to-many',
                                                          'join_table'=> 'tasks_documents', 'join_key_lhs'=>'task_id', 'join_key_rhs'=>'document_id'))

)

?>

